import { useSelector, useDispatch } from 'react-redux'
import { increment, decrement } from './store/actions/counter'

export default function App() {
  const dispatch = useDispatch()
  const counter = useSelector((state) => state.counter)
  return (
    <div>
      <h3>{counter}</h3>
      <button onClick={() => dispatch(increment(1))}>+1</button>
      <button onClick={() => dispatch(increment(5))}>+5</button>
      <button onClick={() => dispatch(decrement(1))}>-1</button>
      <button onClick={() => dispatch(decrement(3))}>-3</button>
    </div>
  )
}
